/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.domain.bo;

import com.comac.ins.common.core.validate.AddGroup;
import com.comac.ins.common.core.validate.EditGroup;
import com.comac.ins.isfd.domain.IsfdDatabaseModelConfigField;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

/**
 * 数据库建模配置字段业务对象 isfd_database_model_config_field
 *
 * @author Lion Li
 * @date 2024-12-13
 */
@Data
@AutoMapper(target = IsfdDatabaseModelConfigField.class)
public class IsfdDatabaseModelConfigFieldBo{


    private Long id;

    /**
     * 模型ID
     */
    @NotNull(message = "模型ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long modelId;

    /**
     * 字段名称
     */
    @NotBlank(message = "字段名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String fieldName;

    /**
     * 字段中文名称
     */
    @NotBlank(message = "字段中文名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String fieldChineseName;

    /**
     * 字段描述
     */
    private String fieldDescription;

    /**
     * 字段类型
     */
    @NotBlank(message = "字段类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String fieldType;

    /**
     * 子字段
     */
    private List<IsfdDatabaseModelConfigFieldBo> fieldList;

    /**
     * 默认值
     */
    private String defaultValue;

    /**
     * 是否允许为空
     */
    @NotNull(message = "是否允许为空不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer isNullable;

    /**
     * 是否是唯一键
     */
    @NotNull(message = "是否是唯一键不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer isUnique;

    /**
     * 是否是关键字段
     */
    @NotNull(message = "是否是关键字段不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer isKeyField;

    /**
     * 是否已关联
     */
//    private Integer isRelated;

    /**
     * 是否是树展示字段
     */
    private Integer isTreeDisplayField;
}
